/* **********************************************************
 * Copyright 2010 Dimitar Vangelovski
 *
 * This file is part of the Gens3 3D Engine.
 * 
 * The Gens3 3D Engine is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 * 
 * The Gens3 3D Engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with the Gens3 3D Engine; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 * **********************************************************/


#include "common.h"
#include "GeomObject.h"
#include "Mesh.h"

CGeomObject::CGeomObject()
{
	m_pMesh = NULL;
	m_strNodeName = "noname";
	m_bPropCastShadow = false;
	m_bPropRecvShadow = false;
	m_nMaterialRef = -1;
	m_bVisible = false;
	m_bAnimated = false;
}

CGeomObject::CGeomObject(const CGeomObject &other)
{
	m_pMesh = other.GetMesh();
	m_strNodeName = other.GetNodeName();
	m_bPropCastShadow = other.GetPropCastShadow();
	m_bPropRecvShadow = other.GetPropRecvShadow();
	m_nMaterialRef = other.GetMaterialRef();
	m_bVisible = other.IsVisible();
	m_bAnimated = other.IsAnimated();
}

CGeomObject::CGeomObject(std::string strNodeName, bool bPropCastShadow, bool bPropRecvShadow, int nMaterialRef, CMesh *pMesh)
{
	m_pMesh = pMesh;
	m_strNodeName = strNodeName;
	m_bPropCastShadow = bPropCastShadow;
	m_bPropRecvShadow = bPropRecvShadow;
	m_nMaterialRef = nMaterialRef;
	m_bVisible = true;
	m_bAnimated = false;
}

CGeomObject::~CGeomObject()
{
	if (m_pMesh)
	{
		delete m_pMesh;
	}
}
